package com.to8to.kitt.strategy;

import java.util.List;
import java.util.Random;

public class RandomStrategy<T> implements SelectorStrategy<T>
{
    private final Random random = new Random();
	@Override
	public T select(List<T> instances) {
		if ( instances.size() == 0 )
			return null;
		int thisIndex = random.nextInt(instances.size());
        return instances.get(thisIndex);
	}
}